/*package com.pactera.integral.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import com.pactera.integral.common.jpa.criteria.Criteria;
import com.pactera.integral.common.jpa.criteria.Restrictions;
import com.pactera.integral.dao.AdditionalScoreDao;
import com.pactera.integral.entity.AdditionalScore;
import com.pactera.integral.service.AdditionalScoreService;

@Service//("/additionalScoreService")
public class AdditionalScoreServiceImpl  implements AdditionalScoreService {

	@Autowired
	private AdditionalScoreDao additionalScoreDao;
	
	*//**
	 * 添加或修改积分项
	 * @param additionalScore
	 * @throws Exception
	 *//*
	@Override
	public void save(AdditionalScore additionalScore) throws Exception {
		AdditionalScore existingEntity = additionalScoreDao.findByCode(additionalScore.getCode());
		
		if(existingEntity != null) {
			if(!existingEntity.getId().equals(additionalScore.getId())) {
				//不同的ID发现同样的Code视为已存在
				
				throw new Exception("积分编码已存在!");
			} else {
				existingEntity.setCategory(additionalScore.getCategory());
				existingEntity.setEnabled(additionalScore.isEnabled());
				existingEntity.setResult(additionalScore.getResult());
				existingEntity.setScore(additionalScore.getScore());
				existingEntity.setScoreType(additionalScore.getScoreType());
				existingEntity.setDetail(additionalScore.getDetail());
				existingEntity.setRemark(additionalScore.getRemark());
				
				additionalScoreDao.save(existingEntity);
			}
		} else {		
			additionalScore.setEnabled(true);
			additionalScoreDao.save(additionalScore);
		}
	}


	*//**
	 * 删除积分向
	 * @param additionalScoreId
	 * @return Boolean
	 *//*
	@Override
	public Boolean delete(String additionalScoreId) {
		AdditionalScore additionalScore = additionalScoreDao.findById(additionalScoreId);
		additionalScore.setEnabled(false);
		additionalScoreDao.save(additionalScore);
		
		return Boolean.TRUE;
	}

	 *//**
     * 积分向列表
     * @param param
     * @param page
     * @return  Page<AdditionalScore>
     *//*
	@Override
	public Page<AdditionalScore> pageAdditionalScore(Map<String, Object> param, Pageable page) {
		Criteria<AdditionalScore> criteria = new Criteria<AdditionalScore>();
    	if(param != null){
    		criteria.add(Restrictions.eq("enabled", 1));
    		criteria.add(Restrictions.eq("scoreType", (String) param.get("scoreType")));
    	    criteria.add(Restrictions.like("code", (String) param.get("code")));
    	    criteria.add(Restrictions.eq("category", (String) param.get("category")));

    	}
		Page<AdditionalScore> p = additionalScoreDao.findAll(criteria,page);
		
		return p;
	}
	
	*//**
     * 积分向明细
     * @param id
     * @return AdditionalScore
     *//*
	@Override
	public AdditionalScore getAdditionalScore(String id) {
		
		return additionalScoreDao.findById(id);
	}
	
}
*/